from flask import Flask
from settings import Config, db
from article_publish import article_publish
from article_read import article_read
from home_page import home_page
from user_center import user_center
app = Flask(__name__, static_folder='static', static_url_path='')
app.secret_key = 'Your_secret_key&^52@!'
# 添加应用设置
app.config.from_object(Config)
# 利用应用设置初始化数据库
db.init_app(app)

# 将蓝图注册到app中
app.register_blueprint(article_publish, url_prefix='/')
app.register_blueprint(article_read, url_prefix='/')
app.register_blueprint(home_page, url_prefix='/')
app.register_blueprint(user_center, url_prefix='/')

if __name__ == '__main__':
    app.run(debug=True)